@extends('admin.container')

@section('c-head')
    <script type="text/javascript">

        var PAGE_DATA = {
            REST_API: {
                new_brand_url: "{{ route('admin.goods.brand.create') }}", // 新增
                del_multi_url: "{{route('admin.goods.brand.batch-remove')}}", // 删除多条数据
                get_brand_list_url: "{{route('admin.goods.brand.index')}}", // 获取品牌列表数据,搜索
            }
        };
    </script>
@stop

@section('c-body')
    <div class="comm-title">
                    <span class="title-msg">
                        品牌管理
                    </span>
    </div>
    <div class="comm-body">
        <div class="tool-bar-top clearfix" style="padding-top:25px;">
            <a id="new-brand-btn" class="am-btn am-btn-success am-btn-xs"
               style="float:left;" href="{{ route('admin.goods.brand.create')}}">
                新增
            </a>

            <div style="margin-left:280px; width:600px;float: left;">
                <div class="input-unit">
                                <span class="key-txt">
                                    品牌全称：
                                </span>
                    <input class="val-input" id="brand-full-name"/>
                </div>
              {{--  <div class="input-unit">
                                <span class="key-txt">
                                    所属分类：
                                </span>
                    <input class="val-input" id="brand-classify"/>
                </div>--}}
            </div>
            <button id="search-btn" type="button" class="am-btn am-btn-success am-btn-xs"
                    style="float:left;">
                搜索
            </button>
        </div>
        <table class="am-table am-table-striped am-table-hover am-table-centered brand-manage-tbl"
               style="">
            <thead>
            <tr>
                <th style="width:5%">
                                    <span style="visibility:hidden;">
                                        1
                                    </span>
                </th>
                <th>
                    排序
                </th>
                <th>
                    品牌名称
                </th>
               {{-- <th>
                    所属分类
                </th>--}}
                <th>
                    品牌图片标识
                </th>
                <th>
                    推荐
                </th>
                <th style="width:15%">
                    操作
                </th>
            </tr>
            </thead>
            <tbody id="brand-context">
            </tbody>
        </table>
        <div class="tool-bar-bottom clearfix">
            <div class="unit">
                <input id="sel-all-chk" type="checkbox" class="mid" style="position: relative; top:13px;"
                        />
            </div>
            <div class="unit">
                <label for="sel-all-chk" style="cursor:pointer;font-weight:300;">
                    全选
                </label>
            </div>
            <div class="unit">
                <button id="del-multi-btn" type="button" class="am-btn am-btn-default am-btn-xs"
                        style="position: relative;float:left;top:5px;">
                    删除
                </button>
            </div>
        </div>
        <div id="comm-paging" class="admin-paging"></div>
    </div>

    <script type="text/template" id="tbl-list-templ">
        <% _.each(obj, function(item){   %>
        <tr>
            <td class="sel-chk" style="cursor:pointer;">
                <input id="<%=item.id%>" type="checkbox"/>
            </td>
            <td>
        <span class="am-badge am-badge-b2b am-text-default">
            <%=item.sort%>
        </span>
            </td>
            <td>
        <span class="am-badge am-badge-b2b am-text-default" style=" display: block;
width:80%;max-width:220px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;margin: 0 auto;
  margin-top: 15px;
" title="<%=item.name%>">
            <%=item.name%>
        </span>
            </td>
           {{-- <td style="max-width:135px;" title="<%=item.category_name%>">

                <%=item.category_name%>
            </td>--}}
            <td>
                <img class="brand-pic" src="<%=item.logo%>"/>
            </td>
            <td>
                <% if(item.recommend == "0") { %>
                <i class="icon-ok"></i>
                <% } else { %>
                <i class="icon-ok active"></i>
                <% } %>
            </td>
            <td style="width:15%">
                <div class="operate-btns-2 clearfix">
                    <a id="" type="button"
                       class="edit-brand-btn am-btn am-btn-primary am-btn-xs"
                       href="<%=item.edit_href %>"
                       style="float:left;">
                        编辑
                    </a>
                    <button id="" type="button" class="del-brand-btn am-btn am-btn-default am-btn-xs"
                            style="float:left; margin-left: 10px;" href="<%=item.delete_href %>" code="<%=item.id%>">
                        删除
                    </button>
                </div>
            </td>
        </tr>
        <% }); %>
    </script>

    <script src="/assets/b2b/admin/js/libs/jquery.paging.min.js"></script>
    <script src="/assets/b2b/admin/js/libs/dialog-min.js"></script>

    <script src=" /assets/b2b/admin/js/pages/05.js">
    </script>
@stop